<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .one{color: blue}
        .two{color: red}
        .three{color: yellow}
    </style>
</head>
<body>
<h1>模板传值</h1>
<div class="one">{{ n1 }}</div>
<div class="two">{{ n2 }}</div>
<div class="two">{{ n2.0 }}</div>
<div class="two">{{ n2.1 }}</div>
<div class="two">{{ n2.2 }}</div>
<div class="two">{{ n2.3 }}</div>
<div class="three">{{ n3 }}</div>
<br>
<h2>支持for循环</h2>
<ul>
    {% for item in n2 %}
    <li>{{ item }}</li>
    {% endfor %}
</ul>
<ul>
    {% for item in n3.keys %}
    <li>{{ item }}</li>
    {% endfor %}
</ul>
<ul>
    {% for item in n3.values %}
    <li>{{ item }}</li>
    {% endfor %}
</ul>
<ul>
    {% for key, value in n3.items %}
    <li>{{ key }} - {{ value }}</li>
    {% endfor %}
</ul>

<h2>支持if判断</h2>
{% if res == 'success' %}
    <span>成功</span>
{% elif res == 'fail' %}
    <span>失败</span>
{% else %}
    <span>未知请求</span>
{% endif %}
</body>
</html>